var c=Object.defineProperty;var i=(e,t,o)=>t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var n=(e,t,o)=>i(e,typeof t!="symbol"?t+"":t,o);import{c as g,bj as r,r as l,j as a,b as d}from"./index-BbhvnJnP.js";import{R as m}from"./REQ-B26XigaO.js";class p{constructor(){n(this,"getBgImageLink",()=>"https://t.alcy.cc/fj");n(this,"getBgImage",async()=>await m({url:"https://t.alcy.cc/fj",method:"get"}))}}const u=new p,f=g(e=>{const t=r.get();let o=u.getBgImageLink();return t!=null&&t.src!=""&&(o=t.src),{src:o,setSrc:s=>{r.set({src:s}),e({src:s})}}}),h=d(({css:e,token:t})=>({container:e`
            position: fixed;
            left: 0;
            top: 0;
            width: 100vw;
            height: 100vh;
            pointer-events: none;
            background-color: ${t.colorBgContainer};
            z-index: -1;

            img {
                position: absolute;
                left: 0;
                top: 0;
                width: 100%;
                height: 100%;
                opacity: 0;
                transition: all 1s;
                transform: scale(1.5);
                z-index: 1;
                object-fit: cover;
                object-position: center;
            }
            
            .bg-loaded {
                opacity: 1;
                transform: scale(1);
            }

            canvas {
                position: absolute;
                left: 0;
                top: 0;
                width: 100%;
                height: 100%;
                z-index: 2;
            }
        `})),w=()=>{const e=l.useRef(null),t=h().styles,o=f(s=>s.src);return a.jsx("div",{className:t.container,ref:e,children:a.jsx("img",{onLoad:s=>{s.target instanceof HTMLImageElement&&s.target.classList.add("bg-loaded")},onError:()=>{window.messageApi.error("背景图加载失败，请检查设置").then()},src:o,alt:"背景图"})})};export{w as B,f as u};
